<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<meta name="theme-color" content="#222"><meta name="generator" content="Hexo 6.3.0">

  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">



<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/css/all.min.css" integrity="sha256-Z1K5uhUaJXA7Ll0XrZ/0JhX4lAtZFpT6jkKrEDT0drU=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.1.1/animate.min.css" integrity="sha256-PR7ttpcvz8qrF57fur/yAx1qXMFJeJFiA6pSzWi0OIE=" crossorigin="anonymous">

<script class="next-config" data-name="main" type="application/json">{"hostname":"example.com","root":"/","images":"/images","scheme":"Muse","darkmode":false,"version":"8.14.1","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12},"copycode":{"enable":false,"style":null},"bookmark":{"enable":false,"color":"#222","save":"auto"},"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"stickytabs":false,"motion":{"enable":true,"async":false,"transition":{"menu_item":"fadeInDown","post_block":"fadeIn","post_header":"fadeInDown","post_body":"fadeInDown","coll_header":"fadeInLeft","sidebar":"fadeInUp"}},"prism":false,"i18n":{"placeholder":"搜索...","empty":"没有找到任何搜索结果：${query}","hits_time":"找到 ${hits} 个搜索结果（用时 ${time} 毫秒）","hits":"找到 ${hits} 个搜索结果"},"path":"/search.xml","localsearch":{"enable":true,"trigger":"auto","top_n_per_article":-1,"unescape":false,"preload":false}}</script><script src="/js/config.js"></script>

    <meta name="description" content="安装流程 安装并启动tomcat 通过tomcat部署activiti 修改一下activiti的配置 访问服务  2.4 Activiti如何使用2.4.1 整合Activiti Activiti是一个工作流引擎，业务系统使用Activiti来对系统的业务流程进行自动化管理，为了方便业务系统访问（操作）Activiti的接口或功能，通常将Activiti和业务系统的环境集成在一起。  2.4.2">
<meta property="og:type" content="article">
<meta property="og:title" content="活动流——Activiti">
<meta property="og:url" content="http://example.com/2023/02/26/%E6%B4%BB%E5%8A%A8%E6%B5%81%E2%80%94%E2%80%94Activiti/index.html">
<meta property="og:site_name" content="JsyBlog">
<meta property="og:description" content="安装流程 安装并启动tomcat 通过tomcat部署activiti 修改一下activiti的配置 访问服务  2.4 Activiti如何使用2.4.1 整合Activiti Activiti是一个工作流引擎，业务系统使用Activiti来对系统的业务流程进行自动化管理，为了方便业务系统访问（操作）Activiti的接口或功能，通常将Activiti和业务系统的环境集成在一起。  2.4.2">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://www.activiti.org/userguide/6.latest/images/api.services.png">
<meta property="article:published_time" content="2023-02-25T19:14:17.000Z">
<meta property="article:modified_time" content="2023-04-05T19:47:13.779Z">
<meta property="article:author" content="SongyangJi">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://www.activiti.org/userguide/6.latest/images/api.services.png">


<link rel="canonical" href="http://example.com/2023/02/26/%E6%B4%BB%E5%8A%A8%E6%B5%81%E2%80%94%E2%80%94Activiti/">



<script class="next-config" data-name="page" type="application/json">{"sidebar":"","isHome":false,"isPost":true,"lang":"zh-CN","comments":true,"permalink":"http://example.com/2023/02/26/%E6%B4%BB%E5%8A%A8%E6%B5%81%E2%80%94%E2%80%94Activiti/","path":"2023/02/26/活动流——Activiti/","title":"活动流——Activiti"}</script>

<script class="next-config" data-name="calendar" type="application/json">""</script>
<title>活动流——Activiti | JsyBlog</title>
  








  <noscript>
    <link rel="stylesheet" href="/css/noscript.css">
  </noscript>
</head>

<body itemscope itemtype="http://schema.org/WebPage" class="use-motion">
  <div class="headband"></div>

  <main class="main">
    <div class="column">
      <header class="header" itemscope itemtype="http://schema.org/WPHeader"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏" role="button">
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <i class="logo-line"></i>
      <p class="site-title">JsyBlog</p>
      <i class="logo-line"></i>
    </a>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger" aria-label="搜索" role="button">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>



<nav class="site-nav">
  <ul class="main-menu menu"><li class="menu-item menu-item-home"><a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a></li><li class="menu-item menu-item-tags"><a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a></li><li class="menu-item menu-item-categories"><a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a></li><li class="menu-item menu-item-archives"><a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a></li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup"><div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off" maxlength="80"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close" role="button">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div class="search-result-container no-result">
  <div class="search-result-icon">
    <i class="fa fa-spinner fa-pulse fa-5x"></i>
  </div>
</div>

    </div>
  </div>

</header>
        
  
  <aside class="sidebar">

    <div class="sidebar-inner sidebar-nav-active sidebar-toc-active">
      <ul class="sidebar-nav">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <div class="sidebar-panel-container">
        <!--noindex-->
        <div class="post-toc-wrap sidebar-panel">
            <div class="post-toc animated"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#%E5%AE%89%E8%A3%85%E6%B5%81%E7%A8%8B"><span class="nav-number">1.</span> <span class="nav-text">安装流程</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2-4-Activiti%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8"><span class="nav-number">2.</span> <span class="nav-text">2.4 Activiti如何使用</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#2-4-1-%E6%95%B4%E5%90%88Activiti"><span class="nav-number">2.1.</span> <span class="nav-text">2.4.1 整合Activiti</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2-4-2-%E4%B8%9A%E5%8A%A1%E6%B5%81%E7%A8%8B%E5%BB%BA%E6%A8%A1"><span class="nav-number">2.2.</span> <span class="nav-text">2.4.2 业务流程建模</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2-4-3-%E9%83%A8%E7%BD%B2%E4%B8%9A%E5%8A%A1%E6%B5%81%E7%A8%8B"><span class="nav-number">2.3.</span> <span class="nav-text">2.4.3 部署业务流程</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2-4-4-%E5%90%AF%E5%8A%A8%E6%B5%81%E7%A8%8B%E5%AE%9E%E4%BE%8B"><span class="nav-number">2.4.</span> <span class="nav-text">2.4.4 启动流程实例</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2-4-5-%E6%9F%A5%E8%AF%A2%E5%BE%85%E5%8A%9E%E4%BB%BB%E5%8A%A1"><span class="nav-number">2.5.</span> <span class="nav-text">2.4.5 查询待办任务</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2-4-6-%E5%A4%84%E7%90%86%E5%BE%85%E5%8A%9E%E4%BB%BB%E5%8A%A1"><span class="nav-number">2.6.</span> <span class="nav-text">2.4.6 处理待办任务</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2-4-7-%E7%BB%93%E6%9D%9F%E6%B5%81%E7%A8%8B"><span class="nav-number">2.7.</span> <span class="nav-text">2.4.7 结束流程</span></a></li></ol></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#Activi-23%E5%BC%A0%E8%A1%A8%E7%9A%84%E5%90%AB%E4%B9%89"><span class="nav-number"></span> <span class="nav-text">Activi 23张表的含义</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#5-1%E3%80%81Service%E6%9C%8D%E5%8A%A1%E8%AF%B4%E6%98%8E"><span class="nav-number">1.</span> <span class="nav-text">5.1、Service服务说明</span></a><ol class="nav-child"><li class="nav-item nav-level-6"><a class="nav-link" href="#5-1-1%E3%80%81RepositoryService%E4%BB%93%E5%BA%93%E6%9C%8D%E5%8A%A1"><span class="nav-number">1.0.0.0.1.</span> <span class="nav-text">5.1.1、RepositoryService仓库服务</span></a></li><li class="nav-item nav-level-6"><a class="nav-link" href="#5-1-2%E3%80%81%E8%BF%90%E8%A1%8C%E6%97%B6%E6%9C%8D%E5%8A%A1"><span class="nav-number">1.0.0.0.2.</span> <span class="nav-text">5.1.2、运行时服务</span></a></li><li class="nav-item nav-level-6"><a class="nav-link" href="#5-1-3%E3%80%81%E4%BB%BB%E5%8A%A1%E6%9C%8D%E5%8A%A1"><span class="nav-number">1.0.0.0.3.</span> <span class="nav-text">5.1.3、任务服务</span></a></li><li class="nav-item nav-level-6"><a class="nav-link" href="#5-1-4%E3%80%81%E8%AE%A4%E8%AF%81%E6%9C%8D%E5%8A%A1"><span class="nav-number">1.0.0.0.4.</span> <span class="nav-text">5.1.4、认证服务</span></a></li><li class="nav-item nav-level-6"><a class="nav-link" href="#5-1-5%E3%80%81%E5%8E%86%E5%8F%B2%E6%9C%8D%E5%8A%A1"><span class="nav-number">1.0.0.0.5.</span> <span class="nav-text">5.1.5、历史服务</span></a></li><li class="nav-item nav-level-6"><a class="nav-link" href="#5-1-6%E3%80%81%E8%A1%A8%E5%8D%95%E6%9C%8D%E5%8A%A1"><span class="nav-number">1.0.0.0.6.</span> <span class="nav-text">5.1.6、表单服务</span></a></li></ol></li></ol></li></ol></li></ol></li></ol></div>
        </div>
        <!--/noindex-->

        <div class="site-overview-wrap sidebar-panel">
          <div class="site-author animated" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">SongyangJi</p>
  <div class="site-description" itemprop="description"></div>
</div>
<div class="site-state-wrap animated">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
        <a href="/archives/">
          <span class="site-state-item-count">251</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
          <a href="/categories/">
        <span class="site-state-item-count">45</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
          <a href="/tags/">
        <span class="site-state-item-count">109</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>

        </div>
      </div>
    </div>

    
  </aside>


    </div>

    <div class="main-inner post posts-expand">


  


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://example.com/2023/02/26/%E6%B4%BB%E5%8A%A8%E6%B5%81%E2%80%94%E2%80%94Activiti/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="SongyangJi">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="JsyBlog">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="活动流——Activiti | JsyBlog">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          活动流——Activiti
        </h1>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2023-02-26 03:14:17" itemprop="dateCreated datePublished" datetime="2023-02-26T03:14:17+08:00">2023-02-26</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar-check"></i>
      </span>
      <span class="post-meta-item-text">更新于</span>
      <time title="修改时间：2023-04-06 03:47:13" itemprop="dateModified" datetime="2023-04-06T03:47:13+08:00">2023-04-06</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">分类于</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/FrameWork/" itemprop="url" rel="index"><span itemprop="name">FrameWork</span></a>
        </span>
    </span>

  
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
        <h2 id="安装流程"><a href="#安装流程" class="headerlink" title="安装流程"></a>安装流程</h2><ol>
<li>安装并启动tomcat</li>
<li>通过tomcat部署activiti</li>
<li>修改一下activiti的配置</li>
<li>访问服务</li>
</ol>
<h2 id="2-4-Activiti如何使用"><a href="#2-4-Activiti如何使用" class="headerlink" title="2.4 Activiti如何使用"></a>2.4 Activiti如何使用</h2><h3 id="2-4-1-整合Activiti"><a href="#2-4-1-整合Activiti" class="headerlink" title="2.4.1 整合Activiti"></a>2.4.1 整合Activiti</h3><ul>
<li>Activiti是一个工作流引擎，业务系统使用Activiti来对系统的业务流程进行自动化管理，为了方便业务系统访问（操作）Activiti的接口或功能，通常将Activiti和业务系统的环境集成在一起。</li>
</ul>
<h3 id="2-4-2-业务流程建模"><a href="#2-4-2-业务流程建模" class="headerlink" title="2.4.2 业务流程建模"></a>2.4.2 业务流程建模</h3><ul>
<li>使用Activiti流程建模工具(Activity-designer)定义业务流程(.bpmn文件)。</li>
<li>.bpmn文件就是业务流程定义文件，通过xml定义业务流程。</li>
<li>如果使用其他公司开发的工作引擎一般都提供了可视化的建模工具（Process Designer）用于生成流程定义文件，建模工具操作直观，一般都支持图形化拖拽方式、多窗口的用户界面、丰富的过程图形元素、过程元素拷贝、粘贴、删除等功能。</li>
</ul>
<h3 id="2-4-3-部署业务流程"><a href="#2-4-3-部署业务流程" class="headerlink" title="2.4.3 部署业务流程"></a>2.4.3 部署业务流程</h3><ul>
<li>向Activiti部署业务流程定义(.bpmn文件)。</li>
<li>使用Activiti提供的API向Activiti中部署.bpmn文件（一般情况下还需要一起部署业务流程的图片.png）。</li>
</ul>
<h3 id="2-4-4-启动流程实例"><a href="#2-4-4-启动流程实例" class="headerlink" title="2.4.4 启动流程实例"></a>2.4.4 启动流程实例</h3><ul>
<li>启动一个流程实例表示开始一次业务流程的运行，比如员工请假流程部署完成，如果张三要请假就可以启动一个流程实例，如果李四要请假也需要启动一个流程实例，两个流程的执行互不影响，就好比定义一个Java类，实例化两个Java对象一样，部署的流程就好比Java类，启动一个流程实例就好比new一个Java对象。</li>
</ul>
<h3 id="2-4-5-查询待办任务"><a href="#2-4-5-查询待办任务" class="headerlink" title="2.4.5 查询待办任务"></a>2.4.5 查询待办任务</h3><ul>
<li>因为现在系统的业务流程已经交给Activiti管理，通过Activiti就可以查询当前流程执行到哪里了，当前用户需要办理什么任务了，这些Activiti帮我们管理了，而不像传统方式中需要我们在SQL语句中的WHERE条件中指定当前查询的状态值是多少。</li>
</ul>
<h3 id="2-4-6-处理待办任务"><a href="#2-4-6-处理待办任务" class="headerlink" title="2.4.6 处理待办任务"></a>2.4.6 处理待办任务</h3><ul>
<li>用户查询待办任务后，就可以办理某个任务，如果这任务办理完成还需要其他用户办理，比如采购单创建后由部门经理审核，这个过程也是由Activiti帮我们完成了，不需要我们在代码中硬编码指定下一个任务办理人了</li>
</ul>
<h3 id="2-4-7-结束流程"><a href="#2-4-7-结束流程" class="headerlink" title="2.4.7 结束流程"></a>2.4.7 结束流程</h3><ul>
<li>当任务办理完成没有下一个任务&#x2F;结点了，这个流程实例就完成了。</li>
</ul>
<p>Activiti的后台是有数据库的支持，所有的表都以ACT_开头。 第二部分是表示表的用途的两个字母标识。 用途也和服务的API对应。</p>
<ol>
<li>ACT_RE_: ‘RE’表示repository。 这个前缀的表包含了流程定义和流程静态资源 （图片，规则，等等）。</li>
<li>ACT_RU_: ‘RU’表示runtime。 这些运行时的表，包含流程实例，任务，变量，异步任务等运行中的数据。 Activiti只在流程实例执行过程中保存这些数据， 在流程结束时就会删除这些记录。 这样运行时表可以一直很小速度很快。</li>
<li>ACT_ID_: ‘ID’表示identity。 这些表包含身份信息，比如用户，组等等。</li>
<li>ACT_HI_: ‘HI’表示history。 这些表包含历史数据，比如历史流程实例， 变量，任务等等。</li>
<li>ACT_GE_: 通用数据， 用于不同场景下。</li>
</ol>
<h1 id="Activi-23张表的含义"><a href="#Activi-23张表的含义" class="headerlink" title="Activi 23张表的含义"></a>Activi 23张表的含义</h1><ol>
<li>act_ge_bytearray	二进制数据表</li>
<li>act_ge_property	属性数据表，存储整个流程引擎级别的数据</li>
<li>act_hi_actinst	历史节点表</li>
<li>act_hi_attachment	历史附件表</li>
<li>act_hi_comment	历史意见表</li>
<li>act_hi_identitylink	历史流程人员表</li>
<li>act_hi_detail	历史详情表</li>
<li>act_hi_procinst	历史流程实例表</li>
<li>act_hi_taskinst	历史任务实例表</li>
<li>act_hi_varinst	历史变量表</li>
<li>act_hi_group	用户组变量表</li>
<li>act_id_info	用户扩展信息表</li>
<li>act_id_membership	用户与用户组对应信息表</li>
<li>act_id_user	用户信息表</li>
<li>act_re_deployment	部署信息表</li>
<li>act_re_model	流程设计模型部署表</li>
<li>act_re_procdef	流程定义数据表</li>
<li>act_ru_event_subscr	throwEvent catchEvent 时间监听信息表</li>
<li>act_ru_execution	运行时流程执行实例表</li>
<li>act_ru_identitylink	运行时流程人员表，主要存储任务节点与参与者的相关信息</li>
<li>act_ru_job	运行时定时任务数据表</li>
<li>act_ru_task	运行时任务节点表</li>
<li>act_ru_variable	运行时流程变量数据表</li>
</ol>
<p>比较的重要的有这几张表</p>
<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">SELECT</span> <span class="operator">*</span> <span class="keyword">FROM</span> act_re_deployment;   <span class="comment">-- 一 流程部署表</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">SELECT</span> <span class="operator">*</span> <span class="keyword">FROM</span> act_ge_bytearray;    <span class="comment">-- 二 流程二进制表</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">SELECT</span> <span class="operator">*</span> <span class="keyword">FROM</span> act_re_procdef;      <span class="comment">-- 三 流程定义表</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">SELECT</span> <span class="operator">*</span> <span class="keyword">FROM</span> act_ru_execution;    <span class="comment">-- 四 流程正在运行表</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">SELECT</span> <span class="operator">*</span> <span class="keyword">FROM</span> act_hi_procinst;     <span class="comment">-- 五 流程实例历史表</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">SELECT</span> <span class="operator">*</span> <span class="keyword">FROM</span> act_ru_task;         <span class="comment">-- 六 流程当前任务表</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">SELECT</span> <span class="operator">*</span> <span class="keyword">FROM</span> act_hi_taskinst;     <span class="comment">-- 七 流程历史任务表</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">SELECT</span> <span class="operator">*</span> <span class="keyword">FROM</span> act_hi_actinst;      <span class="comment">-- 八 流程历史活动节点表</span></span><br></pre></td></tr></table></figure>





<h2 id="5-1、Service服务说明"><a href="#5-1、Service服务说明" class="headerlink" title="5.1、Service服务说明"></a>5.1、Service服务说明</h2><p><img src="https://www.activiti.org/userguide/6.latest/images/api.services.png"></p>
<h6 id="5-1-1、RepositoryService仓库服务"><a href="#5-1-1、RepositoryService仓库服务" class="headerlink" title="5.1.1、RepositoryService仓库服务"></a>5.1.1、RepositoryService仓库服务</h6><p>仓库服务是存储相关的服务，一般用来部署流程文件，获取流程文件，查询流程定义信息等操作，是引擎中的一个重要的服务。</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">/** 仓库服务 */  </span><br><span class="line">RepositoryService repositoryService = engine.getRepositoryService(); </span><br></pre></td></tr></table></figure>

<h6 id="5-1-2、运行时服务"><a href="#5-1-2、运行时服务" class="headerlink" title="5.1.2、运行时服务"></a>5.1.2、运行时服务</h6><p>流程运行时的流程实例，流程定义，流程版本，流程节点等信息，使用运行时服务操作，是引擎中的一个重要的服务</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">/** 运行时服务 */  </span><br><span class="line">RuntimeService runtimeService = engine.getRuntimeService();  </span><br></pre></td></tr></table></figure>

<h6 id="5-1-3、任务服务"><a href="#5-1-3、任务服务" class="headerlink" title="5.1.3、任务服务"></a>5.1.3、任务服务</h6><p>流程运行时的会产生任务，接收、办理、完成等操作使用任务服务完成，是引擎中的一个重要的服务</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">/** 任务服务 */  </span><br><span class="line">TaskService taskService = engine.getTaskService();  </span><br></pre></td></tr></table></figure>

<h6 id="5-1-4、认证服务"><a href="#5-1-4、认证服务" class="headerlink" title="5.1.4、认证服务"></a>5.1.4、认证服务</h6><p>流程运行过程中的一些用户信息，组信息等操作使用认证服务，但是认证服务一般只作为辅助，每一个系统都有一个比较完整的人员系统</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">/** 认证服务 */  </span><br><span class="line">//一般不使用自带的认证服务，每个系统都有自己的认证系统  </span><br><span class="line">IdentityService identityService = engine.getIdentityService();  </span><br></pre></td></tr></table></figure>

<h6 id="5-1-5、历史服务"><a href="#5-1-5、历史服务" class="headerlink" title="5.1.5、历史服务"></a>5.1.5、历史服务</h6><p>流程运行时，和运行完成之后的一些历史信息，包括历史任务，历史节点等，是引擎中的一个重要的服务</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">/** 历史服务 */  </span><br><span class="line">HistoryService historyService = engine.getHistoryService();</span><br></pre></td></tr></table></figure>

<h6 id="5-1-6、表单服务"><a href="#5-1-6、表单服务" class="headerlink" title="5.1.6、表单服务"></a>5.1.6、表单服务</h6><p>流程运行时的任务表单信息，是引擎中的一个辅助的服务</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">/** 表单服务 */  </span><br><span class="line">FormService formService = engine.getFormService();  </span><br></pre></td></tr></table></figure>






    </div>

    
    
    

    <footer class="post-footer">

        

          <div class="post-nav">
            <div class="post-nav-item">
                <a href="/2023/02/26/SomeNotBadWebsites/" rel="prev" title="SomeNotBadWebsites">
                  <i class="fa fa-chevron-left"></i> SomeNotBadWebsites
                </a>
            </div>
            <div class="post-nav-item">
                <a href="/2023/02/27/BPMN/" rel="next" title="BPMN2.0介绍">
                  BPMN2.0介绍 <i class="fa fa-chevron-right"></i>
                </a>
            </div>
          </div>
    </footer>
  </article>
</div>






</div>
  </main>

  <footer class="footer">
    <div class="footer-inner">


<div class="copyright">
  &copy; 
  <span itemprop="copyrightYear">2023</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">SongyangJi</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" rel="noopener" target="_blank">Hexo</a> & <a href="https://theme-next.js.org/muse/" rel="noopener" target="_blank">NexT.Muse</a> 强力驱动
  </div>

    </div>
  </footer>

  
  <div class="toggle sidebar-toggle" role="button">
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
  </div>
  <div class="sidebar-dimmer"></div>
  <div class="back-to-top" role="button" aria-label="返回顶部">
    <i class="fa fa-arrow-up fa-lg"></i>
    <span>0%</span>
  </div>

<noscript>
  <div class="noscript-warning">Theme NexT works best with JavaScript enabled</div>
</noscript>


  
  <script src="https://cdnjs.cloudflare.com/ajax/libs/animejs/3.2.1/anime.min.js" integrity="sha256-XL2inqUJaslATFnHdJOi9GfQ60on8Wx1C2H8DYiN1xY=" crossorigin="anonymous"></script>
<script src="/js/comments.js"></script><script src="/js/utils.js"></script><script src="/js/motion.js"></script><script src="/js/schemes/muse.js"></script><script src="/js/next-boot.js"></script>

  <script src="https://cdnjs.cloudflare.com/ajax/libs/hexo-generator-searchdb/1.4.1/search.js" integrity="sha256-1kfA5uHPf65M5cphT2dvymhkuyHPQp5A53EGZOnOLmc=" crossorigin="anonymous"></script>
<script src="/js/third-party/search/local-search.js"></script>





  





</body>
</html>
